package com.yowasa.xiuxian.engine.travel.adventure;

import com.google.common.collect.Sets;
import com.yowasa.xiuxian.engine.travel.AdventureInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.MapEnum;
import com.yowasa.xiuxian.entity.enums.RefreshType;
import com.yowasa.xiuxian.service.helper.ItemHelper;
import com.yowasa.xiuxian.service.helper.ResourceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * 金陵大厨 一次刷新仅能被触发一次
 * 上架一个鲜香锅巴
 */
@Component
public class QianFengZhiShiTUADV implements AdventureInterface {


    @Autowired
    private ResourceHelper resourceHelper;
    @Autowired
    private ItemHelper itemHelper;

    @Override
    public Set<MapEnum> limitMaps() {
        //程曦
        return Sets.newHashSet(MapEnum.PU_GONG_YING_HAI);
    }

    public boolean limitCheck(UserBO user) {
        return resourceHelper.checkHaveResource(user.getGuildId(), this.getClass().getName(), RefreshType.LOCK_TIME);
    }

    @Override
    public String exec(UserBO user) {
        resourceHelper.lockResource(user.getGuildId(), this.getClass().getName(), 10 * 360);
        itemHelper.addItem(user, "千风之诗图纸", 1);
        String msg = "在秘境探险时你发现了极具古蒙德风格的装饰雕花，\n你沿着雕花向深处走，走到尽头，窄小的洞穴逐渐开阔，\n房间摆这不少只在古书上见过的装饰品，曾经厚重的书架也有点摇摇欲坠的架势，\n你翻了翻不少的书都失传已久，其中一本破破烂烂的书吸引了你的注意，" +
                "\n你打开翻阅其中竟然夹杂着装备[千风之诗]的锻造图纸";
        return msg;
    }


    public boolean isConflict() {
        return true;
    }
    public int weight() {
        return 1;
    }

}
